$(function(){
    fetch(`http://chst.vip:1234/api/getinlanddiscount`)
    .then(body=>body.json())
    .then(res=>{
        let txt = ''
        res.result.forEach(item => {
            txt += `<li productid='${item.productId}'>
                    ${item.productImg}
                    <div class="text">
                        <p>${item.productName}</p>
                        <p>${item.productPrice}</p>
                        <span>${item.productFrom}</span>
                        <span>${item.productTime}</span>
                    </div>
                </li>` 
        })
        $('.xq').html(txt)
        $('.xq li').click(function(){
            var productid = $(this).attr('productid')
            location.href = `./guoneizhekou_xq.html?productid=${productid}`
        })
    })
    $('.header_logo').click(function(){
        location.href = '../index.html'
    })
})